<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <div class="box">
        <input type="text" v-model.number="num1">
        <select v-model="xz">
            <option value="+">+</option>
            <option value="-">-</option>
            <option value="*">*</option>
            <option value="/">/</option>
        </select>
        <input type="text" v-model.number="num2">
        <button @click="js()">计算</button>
        <div>{{zong}}</div>
    </div>

    <script>
        new Vue({
            el: '.box',
            data: {
                num1: '',
                num2: '',
                zong: 0,
                xz: ''
            },
            methods: {
                js() {
                    if (this.xz == '+') {
                        this.zong = parseFloat(this.num1) + parseFloat(this.num2)
                    } else if (this.xz == '-') {
                        this.zong = this.num1 - this.num2
                    } else if (this.xz == '*') {
                        this.zong = this.num1 * this.num2
                    } else if (this.xz == '/') {
                        this.zong = this.num1 / this.num2
                    }
                }
            }
        })
    </script>

</body>

</html>